/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package ch04_01;

/**
 *
 * @author osa
 */
public class CardSet {

    int NUM_OF_CARDS = 52;
    Card[] cards = new Card[NUM_OF_CARDS];
    int offset = 0;

    CardSet() {
        for(String s : Card.getSuits()) {
            for(String r : Card.getRanks()) {
                Card c = new Card(s, r);
                cards[offset] = c;
                offset++;
            }
        }
    }

    public Card getCard() {
        Card ret = cards[offset%NUM_OF_CARDS];
        offset++;
        return ret;
    }

    public Card[] getAllCards() {
        return cards;
    }

}
